<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<input type="hidden" id="id" name="id">
			<div class='form-group'>
				<label class='col-md-2 control-label'>apppayid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='apppayid' type='text' name='apppayid' id='apppayid' data-bv-notempty='true' data-bv-notempty-message='apppayid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>paymentid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='paymentid' type='text' name='paymentid' id='paymentid' data-bv-notempty='true' data-bv-notempty-message='paymentid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>recipeno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='recipeno' type='text' name='recipeno' id='recipeno' data-bv-notempty='true' data-bv-notempty-message='recipeno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>hisregno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='hisregno' type='text' name='hisregno' id='hisregno' data-bv-notempty='true' data-bv-notempty-message='hisregno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>treatmentno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='treatmentno' type='text' name='treatmentno' id='treatmentno' data-bv-notempty='true' data-bv-notempty-message='treatmentno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>groupid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='groupid' type='text' name='groupid' id='groupid' data-bv-notempty='true' data-bv-notempty-message='groupid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>paystaus</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='paystaus' type='text' name='paystaus' id='paystaus' data-bv-notempty='true' data-bv-notempty-message='paystaus 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>unpayreason</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='unpayreason' type='text' name='unpayreason' id='unpayreason' data-bv-notempty='true' data-bv-notempty-message='unpayreason 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>payjsbz</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='payjsbz' type='text' name='payjsbz' id='payjsbz' data-bv-notempty='true' data-bv-notempty-message='payjsbz 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>deptcode1</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='deptcode1' type='text' name='deptcode1' id='deptcode1' data-bv-notempty='true' data-bv-notempty-message='deptcode1 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>deptcode2</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='deptcode2' type='text' name='deptcode2' id='deptcode2' data-bv-notempty='true' data-bv-notempty-message='deptcode2 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>recipettype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='recipettype' type='text' name='recipettype' id='recipettype' data-bv-notempty='true' data-bv-notempty-message='recipettype 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>recipetdate</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='recipetdate' type='text' name='recipetdate' id='recipetdate' data-bv-notempty='true' data-bv-notempty-message='recipetdate 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>fee</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='fee' type='text' name='fee' id='fee' data-bv-notempty='true' data-bv-notempty-message='fee 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>tradeno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='tradeno' type='text' name='tradeno' id='tradeno' data-bv-notempty='true' data-bv-notempty-message='tradeno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>outtradeno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='outtradeno' type='text' name='outtradeno' id='outtradeno' data-bv-notempty='true' data-bv-notempty-message='outtradeno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>hostcode</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='hostcode' type='text' name='hostcode' id='hostcode' data-bv-notempty='true' data-bv-notempty-message='hostcode 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>patientid</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='patientid' type='text' name='patientid' id='patientid' data-bv-notempty='true' data-bv-notempty-message='patientid 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>times</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='times' type='text' name='times' id='times' data-bv-notempty='true' data-bv-notempty-message='times 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>cardno</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='cardno' type='text' name='cardno' id='cardno' data-bv-notempty='true' data-bv-notempty-message='cardno 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>cardtype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='cardtype' type='text' name='cardtype' id='cardtype' data-bv-notempty='true' data-bv-notempty-message='cardtype 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>patientname</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='patientname' type='text' name='patientname' id='patientname' data-bv-notempty='true' data-bv-notempty-message='patientname 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>idcard</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='idcard' type='text' name='idcard' id='idcard' data-bv-notempty='true' data-bv-notempty-message='idcard 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>idcardtype</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='idcardtype' type='text' name='idcardtype' id='idcardtype' data-bv-notempty='true' data-bv-notempty-message='idcardtype 不能为空'>
				</div>
			</div>



			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='appPaymentOrderList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="update()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		initData();
		
		function initData(){
			var id = getUrlParam("id");
			if(id != ""){
				$.ajax({
					type : 'get',
					url : '/appPaymentOrders/'+id,
					async : false,
					success : function(data) {
						$('#apppayid').val(data.apppayid);
						$('#paymentid').val(data.paymentid);
						$('#recipeno').val(data.recipeno);
						$('#hisregno').val(data.hisregno);
						$('#treatmentno').val(data.treatmentno);
						$('#groupid').val(data.groupid);
						$('#paystaus').val(data.paystaus);
						$('#unpayreason').val(data.unpayreason);
						$('#payjsbz').val(data.payjsbz);
						$('#deptcode1').val(data.deptcode1);
						$('#deptcode2').val(data.deptcode2);
						$('#recipettype').val(data.recipettype);
						$('#recipetdate').val(data.recipetdate);
						$('#fee').val(data.fee);
						$('#tradeno').val(data.tradeno);
						$('#outtradeno').val(data.outtradeno);
						$('#hostcode').val(data.hostcode);
						$('#patientid').val(data.patientid);
						$('#times').val(data.times);
						$('#cardno').val(data.cardno);
						$('#cardtype').val(data.cardtype);
						$('#patientname').val(data.patientname);
						$('#idcard').val(data.idcard);
						$('#idcardtype').val(data.idcardtype);

					}
				});
			}
		}

		function update() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'put',
				url : '/appPaymentOrders',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("修改成功", {shift: -1, time: 1000}, function(){
                        location.href = "appPaymentOrderList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
